<template>
	<view class="container">
		<view class="title">
			<image :src="avatar" @click="information" src="../../static/login.jpg"></image>
			<view class="info">
				<text class="nickname">用户名:{{userInfo.userName}}</text>
				<view>手机号: {{userInfo.mobile}}</view>
			</view>
		</view>
		<view class="item_list">
			<view class="item">
				<view class="wrap">
					<text class="icon-tubiao-"></text>
					<text>姓名:{{userInfo.Name}}</text>
				</view>
			</view>
			<view class="item">
				<view class="wrap">
				<text class="icon-yueliang"></text>
				<text>性别:{{userInfo.sex}}</text>
			</view>
		</view>
		<view class="item">
			<view class="wrap">
				<text class="icon-xingxing"></text>
				<text>生日:{{userInfo.birthday}}</text>
			</view>
		</view>
		<view class="item">
			<view class="wrap">
				<text class="icon-aixin"></text>
				<text>邮箱:{{userInfo.Email}}</text>
			</view>
		</view>
		<view class="item">
			<view class="wrap">
				<text class="icon-shu"></text>
				<text>QQ:{{userInfo.QQ}}</text>
			</view>
		</view>
	</view>
</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: undefined
			}
		},
		onShow() {
			uni.getStorage({
				key:"USER_INFO",
				success: (res) => {
					this.userInfo = res.data;
					this.isSex(this.userInfo.sex);
				}
			})
		},
		methods:{
			isSex(sex){
				if(sex == '1'){
					this.userInfo.sex = '男'
				} else {
					this.userInfo.sex = '女'
				}
			},
		}
	}
</script>

<style lang="scss">
.container{
		background-color: #F8F8F8;
		padding: 0rpx 20rpx;
		height: 100vh;
	},
	
	.title{
		display: flex;
		align-items: center;
		background-color: white;
		padding: 30rpx;
	}
	.title image{
		height: 90rpx;
		width: 90rpx;
		border-radius: 45rpx;
		border: 1px solid #CCCCCC;
		margin-right: 20rpx;
	}
	.item_list{
		margin-top: 10rpx;
	}
	.item{
		display: flex;
		justify-content: space-between;
		height: 89rpx;
		line-height: 89rpx;
		font-size: 30rpx;
		font-weight: 700;
		background-color: white;
		padding: 0rpx 20rpx;
		margin-top: 20rpx;
		border-radius:20rpx;
	}
	.wrap{
		display: flex;
	}
	.wrap text:nth-of-type(1){
		font-size: 40rpx;
		margin-right: 20rpx;
	}
	.nickname{
		margin-right: 19rpx;
	}
	.info{
		line-height: 46rpx;
		font-size: 26rpx;
	}
	.icon{
		 margin-left:auto;
		 width: 150rpx;
		 height: 60rpx;
		 text-align: center;
		 line-height: 60rpx;
		 color: #555555;
		 border: 1px solid #555555;
		 font-size: 26rpx;
		 border-radius: 50rpx;
	}
</style>
